package com.woniuxy.hotel.exception;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.servlet.ModelAndView;

public class MyExceptoinHandler {
	@ExceptionHandler({ MyException.class })
	public ModelAndView execptionHandler(MyException e) {
		System.out.println(e.getMessage());
		ModelAndView modelAndView = new ModelAndView();
		modelAndView.setViewName("/errorInfo.html");
		modelAndView.addObject("info", e.getMessage());
		return modelAndView;
	}
}
